﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class ErrorDay : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["AdminName"] == null)
            Response.Redirect("login.aspx");
        if (!Page.IsPostBack)
        {
                DAL.ErrorLogDALs errorlogdals = new DAL.ErrorLogDALs();
          DataSet ds=      errorlogdals.ExecuteSql("select convert(varchar,[time],111) Date,sum(total) Total from viewerrorlog group by convert(varchar,[time],111) order by Date  desc");

          this.GridView1.DataSource = ds;
          string[] keys =  { "Date" };
          this.GridView1.DataKeyNames = keys;
          this.GridView1.DataBind();
        }
    }
}
